package com.itheima.homework;

public class Test8 {
    public static void main(String[] args) {
        int[] arr = {2, 4, 6, 8, 10};
        System.out.println("数组中最小值为: " + min(arr));
    }

    public static int min(int[] arr) {
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] < min) {
                min = arr[i];
            }
        }
        return min;
    }
}
